'use strict';

//获取数据库的引用
const db = uniCloud.database(); 
// 获取集合的引用 表
const usercollection = db.collection('user');

exports.main = async (event, context) => {
//执行用户注册操作
let { nickname,username,password,userType,identity,emergencyPhone } = event
let res = await usercollection.add({
	nickname,username,password,userType,identity,emergencyPhone
})
//res是用户的唯一id
 return res
};	
